import prompt from '@system.prompt';
export default {
    data: {
        title: 'World',
        multitext:[["a", "b", "c"], ['01','02','03','04','05','06',
        '07','08','09','10','11','12']],
        multitextvalue:'2020-02',//日期显示值
        multitextselect:[50, 0],//默认选择值
    },
    props: {
        title: {
            default: 'selected',
            multitextselect:JSON.stringify(new Date()).substring(1,8),
        },
        showObject: {},
    },
    onInit(){
        let date_year = new Date().getFullYear();
        let date_month = new Date().getMonth();
        this.multitextvalue = JSON.stringify(new Date()).substring(1,8)
        this.multitextselect = [10,date_month]
        let con = 10;
        let arr = [date_year]
        while(con>0){
            con--;
            arr.push(date_year+10-con);
            arr.unshift(date_year-10+con);
        }
        this.multitext[0]=arr;
        this.$watch('multitextvalue', 'onPropertyChange');
    },
    multitextonchange(e) {
        console.log(JSON.stringify(e));
        this.multitextvalue=e.newValue[0]+'-'+e.newValue[1];
        this.$emit('eventType1',{time:e.newValue[0]+'-'+e.newValue[1]})
    },
    onPropertyChange(newV, oldV) {
        console.info('multitextvalue 属性变化 ' + newV + ' ' + oldV);
    },
}
